// https://leetcode.cn/problems/number-of-ways-to-split-array/description/?envType=daily-question&envId=2025-01-13



func waysToSplitArray(nums []int) int {
    n := len(nums)
	pre_sum = make([]int, n + 1)
	for i := 0; i < n; i++ {
		pre_sum[i + 1] = pre_sum[i] + nums[i]
	}
	s := pre_sum[n]
	ans := 0
	for i := 0; i < n; i++ {
		if pre_sum[i] >= s - pre_sum[i] {
			ans += 1
		}
	}
	return ans
}